<!--
 * @Author: wangyuyong
 * @Date: 2020-07-22 13:08:51
 * @LastEditTime: 2020-07-22 15:51:02
 * @FilePath: /blog-manager/src/components/MdEditor.vue
 * @Description: 
-->
<template>
  <div class="container">
    <mavon-editor
      v-model="value"
      :subfield="true"
      :style="'height:' + height"
      @change="textChange"
      @save="save"
    />
  </div>
</template>

<script>
export default {
  data() {
    return {
      value: "",
      defaultData: "preview",
    };
  },
  props: ["height"],
  methods: {
    textChange(value, render) {
      this.$emit("textChange", value, render);
    },
    save() {
      this.$emit("save");
    },
  },
};
</script>

<style scoped>
.container {
  margin: 20px;
}
</style>
